home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
misc_pto
/
blx21
/
vs.cpp
< prev
Wrap
Text File
|
1992-04-22
|
294b
|
30 lines
struct BASE
{
int x;
virtual int f();
BASE(int c) : x(c) {};
};
int BASE::f()
{
return x;
}
struct DERV:BASE
{
DERV(int c) : BASE(c) {};
};
DERV d(1), *p = &d;
int main()
{
int count = 0;
for (long i = 1000000; i; --i)
count += p->f();
return 0;
}